package com.miracle9.game.dao;
import com.miracle9.game.bean.Pager;
import com.miracle9.game.entity.CardDeskResult;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

@Repository
public class CardDeskResultServiceDao extends SqlOperating<CardDeskResult, Integer>
{
  public Pager getByDeskIdAndInterval(int id, String startDate, String endDate, Pager pager)
  {
    return q_CreateSqlsPager("from CardDeskResult where deskId = ? and datetime>=? and datetime<?", pager, new Object[] { Integer.valueOf(id), 
      startDate, endDate });
  }
  
  public void deletePastResult(String date)
  {
	  q_CreateSql("delete from CardDeskResult where datetime<?", new Object[] { date }).executeUpdate();
  }
}
